cmake_minimum_required(VERSION 2.8)

IF(DEFINED PROJECT_NAME)
   set(internal TRUE)
ENDIF(DEFINED PROJECT_NAME)

if(internal)
        # inside rtabmap project (see below for external build)
        SET(RGBDSLAM_INCLUDE_DIRS 
            ${PROJECT_SOURCE_DIR}/utilite/include
            ${PROJECT_SOURCE_DIR}/corelib/include
        )
        SET(RGBDSLAM_LIBRARIES 
            rgbdslam_core
            rgbdslam_utilite
        )
else()
        # external build
        PROJECT( MyProject )

        FIND_PACKAGE(RGBDSLAM REQUIRED)
        FIND_PACKAGE(OpenCV REQUIRED)
        FIND_PACKAGE(PCL 1.7 REQUIRED)
endif()

SET(INCLUDE_DIRS
    ${RGBDSLAM_INCLUDE_DIRS}
)

SET(LIBRARIES
    ${RGBDSLAM_LIBRARIES}
    ${PCL_INCLUDE_DIRS}
)

INCLUDE_DIRECTORIES(${INCLUDE_DIRS})

ADD_EXECUTABLE(camera_driver_test main.cpp)
#TARGET_LINK_LIBRARIES(camera_driver_test ${LIBRARIES})

#if(internal)
#  SET_TARGET_PROPERTIES( camera_driver_test 
#    PROPERTIES OUTPUT_NAME ${PROJECT_PREFIX}-camera_driver_test)
#endif(internal)
